package cate.game.demo.spo;

import cate.game.db.mongo.kv.KvMongo;
import easy.java.time.DateTool;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.bson.types.ObjectId;

import java.util.ArrayList;
import java.util.List;

@Data
@Slf4j
public class DemoStatus extends KvMongo {

    private long initTime = System.currentTimeMillis();

    public String name = "默认值";

    public List<String> roleIds = new ArrayList<>();

    @Override
    public String getKeyPrefix() {
        return KvMongo.KEY_DEMO;
    }

    public void initialize() {
        //this.roleIds.add(ObjectId.get().toString());
        //this.roleIds.add(ObjectId.get().toString());
        log.info("demo状态数据 initTime={}", DateTool.instance().format(initTime));
    }

    public void changeName(String value) {
        this.name = value;
    }
}
